home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / TURB_VIS / RESDMP11 / RESDUMP.DOC < prev    next >
Text File  |  1993-07-28  |  5KB  |  145 lines

  1. RESDMP11.ZIP -- RESDUMP Utility Vs 1.1 (July 1993)
  2. ==================================================
  3.  
  4. For TURBO PASCAL 7.0 and TURBO Vision 2.0.
  5.  
  6.  
  7. Do you use resource files to store menu bars, status lines,
  8. string lists and dialogs with subviews ? Do you need a nice little
  9. resource dumper to document the contents of your resource file
  10. (including 8-bit ASCII charts of your dialogs) ?
  11.  
  12. Well, here it is: RESDUMP.
  13.  
  14.  
  15. RESDUMP handles
  16.  
  17.    TMenubar, TStringlists, TStatusline and
  18.    TDialog with subviews
  19.       TView, TButton, TRadioButton, TCheckBoxes, TListViewer,
  20.       TListBox, TSortedListBox, TInputLine, TLabel, THistory,
  21.       TStaticText, TParamText
  22.  
  23.  
  24. RESDUMP (file name RESDMP11.ZIP) consists of
  25.  
  26.   Main program          : RESDUMP.PAS
  27.   Units                 : RESDUTIL.PAS, DRESFU.PAS,
  28.   Resource file         : RESDUMP.BRS
  29.   Readme file           : RESDUMP.DOC
  30.   Test resource file    : TESTBOX.BRS
  31.   Test resource program : TESTBOX.PAS
  32.   Test output file      : TESTBOX.OUT
  33.  
  34. On invocation RESDUMP looks for the resource file in the same
  35. directory where RESDUMP.EXE is found.
  36.  
  37.  
  38. See the utility unit RESDUTIL.PAS for copyright text.
  39.  
  40.  
  41. RESDUMP.PAS is just the frame, the real work is done in DRESFU.PAS.
  42. Inspect this file how to incorporate your favorite objects.
  43. This is easy if the derived object uses virtually the same
  44. draw method as, and, hence, looks much like its ancestor.
  45.  
  46.  
  47. DRESFU.PAS is somewhat boring; I added object after object as
  48. I stumbled over them and hence this unit grew to its present size.
  49.  
  50.  
  51. I use the resource editor RESEDIT Vs. 2.0 of Blaise Computing Inc.
  52. with TStatusLine objects added by an self-hacked utility.
  53.  
  54.  
  55. Missing features:
  56.   Dump subviews entered directly into the resource file not as part
  57.   of a TDialog object.
  58.  
  59.  
  60. Problems:
  61.   Program cannot correctly clear the heap, if unregistered
  62.   objects are encountered inside TDialog objects. Sort of a
  63.   memory leak. It is not clear to me how TV handles this
  64.   situation. If there is an unregistered object inside a
  65.   TDialog, TV doesn't know how to load this thing and
  66.   apparently stops with loading any other subviews.
  67.   This explains why sometimes you get nearly a complete
  68.   TDialog sometimes not. It depends on the position of
  69.   the unregistered subview in the sequence of all subviews.
  70.   All the program can do is to report the number of the
  71.   unregistered object and to continue.
  72.  
  73.  
  74. How to implement derived subviews of TDialog:
  75.  
  76.   General outline:
  77.     1. Register your new object FOO in the main body of RESDUMP.PAS
  78.  
  79.     2.-4. Changes in procedure ProcessDialogB in unit DRESFU.PAS:
  80.      2. Write a procedure WriteFOO to handle the actual output
  81.         for FOO (compare the many other WriteXXX procedures on
  82.         how to do that). This is not necessary if FOO differs
  83.         from its ancestor only by some methods (except the draw
  84.         method). See below.
  85.      3. Add a function CheckFOO (compare other CheckXXX functions)
  86.      4. Add a block of code like this (compare the other blocks
  87.         in ProcessDialogB)
  88.           IF DB^.FirstThat(@CheckFOO)<>NIL THEN
  89.             BEGIN
  90.              ...
  91.                DB^.ForEach(@WriteFOO);
  92.              ...
  93.             END;
  94.  
  95.  
  96.   Special case handling:
  97.     If the only difference between a derived object and its
  98.     ancestor are overridden methods there isn't much to do:
  99.  
  100.     For instance, consider a TDerivedInputLine object with
  101.     overridden HandleEvent, Valid methods.
  102.  
  103.     Make these changes to procedure ProcessDialogB in DRESFU.PAS
  104.  
  105.       - Write a function CheckDerivedInputLine in analogy to
  106.         CheckInputLine
  107.       - Enter this block of code behind its InputLine counterpart
  108.  
  109.          IF DB^.FirstThat(@CheckDerivedInputLine)<>NIL THEN
  110.            BEGIN
  111.              ownlabel := 0;
  112.              writeln ( outfile,  '  [TDerivedInputLine]');
  113.              writeln ( outfile );
  114.              writeln ( outfile,
  115.              '  Z: Origin    Size  hcxxx Options AMaxLen Label History' );
  116.              DB^.ForEach(@WriteInputLine);
  117.              writeln ( outfile,  '  ---------------------');
  118.              writeln ( outfile );
  119.            END;
  120.  
  121.  
  122. Browse the WriteInputLine procedure. This is a good example
  123. to start with. There are a lot of nice procedures like
  124. Hex, PutBar, PutHatch, PutShadow, PutFrame, TrimText, WrapText,
  125. InsertStaticText, that will do most of what you need. The
  126. Origin/Size mechanism is somewhat unclean but I'm too lazy
  127. to streamline this in the future.
  128.  
  129.  
  130.  
  131. Further development is not intended but ... who knows.
  132.  
  133.  
  134. History
  135. -------
  136.   Vs. 1.0   First version
  137.   Vs. 1.1   Bug fixes, minor enhancements, better TDialog charts,
  138.             better stream management (in case of unregistered objects),
  139.             links between subviews,
  140.  
  141. -------------------------------------------------------------------
  142. Dr. W. Gross, Dept. of Exp. Surgery, Univ. of Heidelberg, Germany
  143. gross@aecds.exchi.uni-heidelberg.de
  144. -------------------------------------------------------------------
  145.